package com.zxjbyte.yiyi.server.modifier;

import java.util.List;

/**
 * 魔改常量
 * @Author zhangxingjia
 * @Date 2023/3/27 16:57
 * @Version: 1.0
 */
public interface ModifierConstant {

    String className = "com.zxjbyte.yiyi.server.modifier.ProjectModifier";
    String className2 = "com.zxjbyte.yiyi.server.modifier.QuickProjectModifier";

    // ========================old============================
    static String groupId() {
        if(className.equals(callerClass())){
            return ProjectModifier.groupId;
        }else {
            return QuickProjectModifier.groupId;
        }
    }

    static String artifactId1() {
        if(className.equals(callerClass())){
            return ProjectModifier.artifactId1;
        }else {
            return QuickProjectModifier.artifactId1;
        }
    }

    static String artifactId2() {
        if(className.equals(callerClass())){
            return ProjectModifier.artifactId2;
        }else {
            return QuickProjectModifier.artifactId2;
        }
    }

    static String packageName() {
        if(className.equals(callerClass())){
            return ProjectModifier.packageName;
        }else {
            return QuickProjectModifier.packageName;
        }
    }

    static String classKeyWords() {
        if(className.equals(callerClass())){
            return ProjectModifier.classKeyWords;
        }else {
            return QuickProjectModifier.classKeyWords;
        }
    }

    // ========================new===========================
    static String newGroupId() {
        if(className.equals(callerClass())){
            return ProjectModifier.newGroupId;
        }else {
            return QuickProjectModifier.newGroupId;
        }
    }

    static String newArtifactId1() {
        if(className.equals(callerClass())){
            return ProjectModifier.newArtifactId1;
        }else {
            return QuickProjectModifier.newArtifactId1;
        }
    }

    static String newArtifactId2() {
        if(className.equals(callerClass())){
            return ProjectModifier.newArtifactId2;
        }else {
            return QuickProjectModifier.newArtifactId2;
        }
    }

    static String newPackageName() {
        if(className.equals(callerClass())){
            return ProjectModifier.newPackageName;
        }else {
            return QuickProjectModifier.newPackageName;
        }
    }

    static String newProjectDir() {
        if(className.equals(callerClass())){
            return ProjectModifier.newProjectDir;
        }else {
            return QuickProjectModifier.newProjectDir;
        }
    }

    static String newClassKeyWords() {
        if(className.equals(callerClass())){
            return ProjectModifier.newClassKeyWords;
        }else {
            return QuickProjectModifier.newClassKeyWords;
        }
    }


    static List<String[]> getLastKeyWords(){
        if(className.equals(callerClass())){
            return ProjectModifier.lastKeyWords();
        }else {
            return QuickProjectModifier.lastKeyWords();
        }
    }



    static String callerClass(){
        StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
        return stackTrace[stackTrace.length - 1].getClassName();
    }
}
